
# split a number to octets, tetrades or whatever
echo "obase=2;ibase=16;3FFF3600" | bc | sed -e :a -e 's/^.\{1,31\}$/0&/;ta' | sed 's/.\{8\}/& /g'

# count number of source lines
find <path> -name <mask> -exec wc -l {} \; | cut -d' ' -f1 | tr '\n' '+' | sed 's/+$/\n/' | bc

